﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using System.Web.UI.WebControls;
using BookShop.Domain.Abstract;
using BookShop.WebUI.Infrastructure;

namespace BookShop.WebUI.Controllers
{
    public class BookController : Controller
    {
        private IBookRepository repository;

        public BookController(IBookRepository bookRepository)
        {
            repository = bookRepository;
        }

        //
        // GET: /Book/
        public ViewResult List()
        {
            string uri= Url.Action("List", "Book",new {id="myid"});
            string ull = Url.RouteUrl("myroute", new
            {
                controller="Book",action="List"
            });
            return View(repository.Books);
        }

        public ViewResult Test()
        {
            DateTime date=new DateTime(1997,10,11);
            ViewBag.Title = "Person";
            ViewData["Name"] = "joker";
            TempData["Fun"] = "Game";
            return View(date);
        }

    }
}